.class public Lcom/instagram/android/widget/IgCheckButton;
.super Landroid/widget/Button;
.source "IgCheckButton.java"

# interfaces
.implements Landroid/widget/Checkable;


# static fields
.field private static final e:[I


# instance fields
.field private a:Landroid/graphics/drawable/Drawable;

.field private b:Z

.field private c:Z

.field private d:Lcom/instagram/android/widget/h;


# direct methods
.method static constructor <clinit>()V
    .locals 3

    .prologue
    .line 30
    const/4 v0, 0x1

    new-array v0, v0, [I

    const/4 v1, 0x0

    const v2, 0x10100a0

    aput v2, v0, v1

    sput-object v0, Lcom/instagram/android/widget/IgCheckButton;->e:[I

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;)V
    .locals 1
    .parameter "context"

    .prologue
    .line 35
    const/4 v0, 0x0

    invoke-direct {p0, p1, v0}, Lcom/instagram/android/widget/IgCheckButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 36
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1
    .parameter "context"
    .parameter "attrs"

    .prologue
    .line 39
    const/4 v0, 0x0

    invoke-direct {p0, p1, p2, v0}, Lcom/instagram/android/widget/IgCheckButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 40
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 2
    .parameter "context"
    .parameter "attrs"
    .parameter "defStyle"

    .prologue
    const/4 v1, 0x0

    .line 43
    invoke-direct {p0, p1, p2, p3}, Landroid/widget/Button;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 46
    invoke-virtual {p0}, Lcom/instagram/android/widget/IgCheckButton;->getCompoundDrawables()[Landroid/graphics/drawable/Drawable;

    move-result-object v0

    aget-object v0, v0, v1

    if-eqz v0, :cond_0

    .line 47
    invoke-virtual {p0}, Lcom/instagram/android/widget/IgCheckButton;->getCompoundDrawables()[Landroid/graphics/drawable/Drawable;

    move-result-object v0

    aget-object v0, v0, v1

    invoke-virtual {p0, v0}, Lcom/instagram/android/widget/IgCheckButton;->setButtonDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 49
    :cond_0
    return-void
.end method


# virtual methods
.method protected drawableStateChanged()V
    .locals 2

    .prologue
    .line 146
    invoke-super {p0}, Landroid/widget/Button;->drawableStateChanged()V

    .line 148
    iget-object v0, p0, Lcom/instagram/android/widget/IgCheckButton;->a:Landroid/graphics/drawable/Drawable;

    if-eqz v0, :cond_0

    .line 149
    invoke-virtual {p0}, Lcom/instagram/android/widget/IgCheckButton;->getDrawableState()[I

    move-result-object v0

    .line 152
    iget-object v1, p0, Lcom/instagram/android/widget/IgCheckButton;->a:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v1, v0}, Landroid/graphics/drawable/Drawable;->setState([I)Z

    .line 154
    invoke-virtual {p0}, Lcom/instagram/android/widget/IgCheckButton;->invalidate()V

    .line 156
    :cond_0
    return-void
.end method

.method public isChecked()Z
    .locals 1
    .annotation runtime Landroid/view/ViewDebug$ExportedProperty;
    .end annotation

    .prologue
    .line 70
    iget-boolean v0, p0, Lcom/instagram/android/widget/IgCheckButton;->b:Z

    return v0
.end method

.method public jumpDrawablesToCurrentState()V
    .locals 1

    .prologue
    .line 165
    invoke-super {p0}, Landroid/widget/Button;->jumpDrawablesToCurrentState()V

    .line 166
    iget-object v0, p0, Lcom/instagram/android/widget/IgCheckButton;->a:Landroid/graphics/drawable/Drawable;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/instagram/android/widget/IgCheckButton;->a:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->jumpToCurrentState()V

    .line 167
    :cond_0
    return-void
.end method

.method protected onCreateDrawableState(I)[I
    .locals 2
    .parameter "extraSpace"

    .prologue
    .line 137
    add-int/lit8 v0, p1, 0x1

    invoke-super {p0, v0}, Landroid/widget/Button;->onCreateDrawableState(I)[I

    move-result-object v0

    .line 138
    invoke-virtual {p0}, Lcom/instagram/android/widget/IgCheckButton;->isChecked()Z

    move-result v1

    if-eqz v1, :cond_0

    .line 139
    sget-object v1, Lcom/instagram/android/widget/IgCheckButton;->e:[I

    invoke-static {v0, v1}, Lcom/instagram/android/widget/IgCheckButton;->mergeDrawableStates([I[I)[I

    .line 141
    :cond_0
    return-object v0
.end method

.method public onRestoreInstanceState(Landroid/os/Parcelable;)V
    .locals 1
    .parameter "state"

    .prologue
    .line 227
    check-cast p1, Lcom/instagram/android/widget/IgCheckButton$SavedState;

    .line 229
    .end local p1
    invoke-virtual {p1}, Lcom/instagram/android/widget/IgCheckButton$SavedState;->getSuperState()Landroid/os/Parcelable;

    move-result-object v0

    invoke-super {p0, v0}, Landroid/widget/Button;->onRestoreInstanceState(Landroid/os/Parcelable;)V

    .line 230
    iget-boolean v0, p1, Lcom/instagram/android/widget/IgCheckButton$SavedState;->a:Z

    invoke-virtual {p0, v0}, Lcom/instagram/android/widget/IgCheckButton;->setChecked(Z)V

    .line 231
    invoke-virtual {p0}, Lcom/instagram/android/widget/IgCheckButton;->requestLayout()V

    .line 232
    return-void
.end method

.method public onSaveInstanceState()Landroid/os/Parcelable;
    .locals 2

    .prologue
    .line 216
    const/4 v0, 0x1

    invoke-virtual {p0, v0}, Lcom/instagram/android/widget/IgCheckButton;->setFreezesText(Z)V

    .line 217
    invoke-super {p0}, Landroid/widget/Button;->onSaveInstanceState()Landroid/os/Parcelable;

    move-result-object v0

    .line 219
    new-instance v1, Lcom/instagram/android/widget/IgCheckButton$SavedState;

    invoke-direct {v1, v0}, Lcom/instagram/android/widget/IgCheckButton$SavedState;-><init>(Landroid/os/Parcelable;)V

    .line 221
    invoke-virtual {p0}, Lcom/instagram/android/widget/IgCheckButton;->isChecked()Z

    move-result v0

    iput-boolean v0, v1, Lcom/instagram/android/widget/IgCheckButton$SavedState;->a:Z

    .line 222
    return-object v1
.end method

.method public performClick()Z
    .locals 1

    .prologue
    .line 64
    invoke-virtual {p0}, Lcom/instagram/android/widget/IgCheckButton;->toggle()V

    .line 65
    invoke-super {p0}, Landroid/widget/Button;->performClick()Z

    move-result v0

    return v0
.end method

.method public setButtonDrawable(Landroid/graphics/drawable/Drawable;)V
    .locals 0
    .parameter "d"

    .prologue
    .line 128
    if-eqz p1, :cond_0

    .line 129
    iput-object p1, p0, Lcom/instagram/android/widget/IgCheckButton;->a:Landroid/graphics/drawable/Drawable;

    .line 132
    :cond_0
    invoke-virtual {p0}, Lcom/instagram/android/widget/IgCheckButton;->refreshDrawableState()V

    .line 133
    return-void
.end method

.method public setChecked(Z)V
    .locals 2
    .parameter "checked"

    .prologue
    .line 79
    iget-boolean v0, p0, Lcom/instagram/android/widget/IgCheckButton;->b:Z

    if-eq v0, p1, :cond_0

    .line 80
    iput-boolean p1, p0, Lcom/instagram/android/widget/IgCheckButton;->b:Z

    .line 81
    invoke-virtual {p0}, Lcom/instagram/android/widget/IgCheckButton;->refreshDrawableState()V

    .line 84
    iget-boolean v0, p0, Lcom/instagram/android/widget/IgCheckButton;->c:Z

    if-eqz v0, :cond_1

    .line 95
    :cond_0
    :goto_0
    return-void

    .line 88
    :cond_1
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/instagram/android/widget/IgCheckButton;->c:Z

    .line 89
    iget-object v0, p0, Lcom/instagram/android/widget/IgCheckButton;->d:Lcom/instagram/android/widget/h;

    if-eqz v0, :cond_2

    .line 90
    iget-object v0, p0, Lcom/instagram/android/widget/IgCheckButton;->d:Lcom/instagram/android/widget/h;

    iget-boolean v1, p0, Lcom/instagram/android/widget/IgCheckButton;->b:Z

    invoke-interface {v0, p0, v1}, Lcom/instagram/android/widget/h;->a(Lcom/instagram/android/widget/IgCheckButton;Z)V

    .line 93
    :cond_2
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/instagram/android/widget/IgCheckButton;->c:Z

    goto :goto_0
.end method

.method public setOnCheckedChangeListener(Lcom/instagram/android/widget/h;)V
    .locals 0
    .parameter "listener"

    .prologue
    .line 104
    iput-object p1, p0, Lcom/instagram/android/widget/IgCheckButton;->d:Lcom/instagram/android/widget/h;

    .line 105
    return-void
.end method

.method public toggle()V
    .locals 1

    .prologue
    .line 52
    iget-boolean v0, p0, Lcom/instagram/android/widget/IgCheckButton;->b:Z

    if-nez v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    invoke-virtual {p0, v0}, Lcom/instagram/android/widget/IgCheckButton;->setChecked(Z)V

    .line 53
    return-void

    .line 52
    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method protected verifyDrawable(Landroid/graphics/drawable/Drawable;)Z
    .locals 1
    .parameter "who"

    .prologue
    .line 160
    invoke-super {p0, p1}, Landroid/widget/Button;->verifyDrawable(Landroid/graphics/drawable/Drawable;)Z

    move-result v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/instagram/android/widget/IgCheckButton;->a:Landroid/graphics/drawable/Drawable;

    if-ne p1, v0, :cond_1

    :cond_0
    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_1
    const/4 v0, 0x0

    goto :goto_0
.end method
